package com.example.demooptimizeif.factory;

import java.util.HashMap;
import java.util.Map;

/**
 * @version 1.0.0
 * @className: ServiceFactory
 * @description:
 * @author: zhangjunfa
 * @date: 2023/9/2 14:07
 */
public class ServiceFactory {

    private static final Map<Integer, AbstractUserService> map = new HashMap<>();
    static {
        map.put(1, new UserServiceImpl());
        map.put(2, new StudentServiceImpl());
        map.put(3, new TeacherServiceImpl());
        map.put(4, new ProgrammerServiceImpl());
    }
    public static void getUserService(Integer medalType) {
         map.get(medalType).doSomethings(medalType);
    }
}
